// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import echarts from 'echarts'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App'
import router from './router'
import lottie from 'vue-lottie';
import axios from 'axios'

//配置公共请求头
axios.defaults.baseURL='http://localhost:9090/config'
//配置全局axios
Vue.prototype.$axios = axios
//配置组件
Vue.component('lottie', lottie)

Vue.prototype.$echarts = echarts;

Vue.config.productionTip = false

Vue.use(ElementUI);

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
})

//跨域
const proxyObj = {}
proxyObj['/'] = {
  target: 'http://localhost:9090',
  changeOrigin: true,
  pathRewrite: {
    '^/': ''
  }
}
module.exports = {
  devServer: {
    host: 'localhost',
    port: 8080,
    proxy: proxyObj
  }
}
